<html>
<head>
    <meta charset="utf-8">
    <title>订单</title>
    <#assign base=request.contextPath  />
    <#setting  number_format="0.##"/>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${base}/frame/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="${base}/sweep/css/app.css" media="all">
    <link rel="stylesheet" href="${base}/sweep/css/mui.min.css" media="all">
    <link rel="stylesheet" type="text/css" href="${base}/sweep/css/style.css" />
    <script src="${base}/backstage/js/jquery-1.8.3.min.js"></script>
    <script src="${base}/sweep/js/mui.min.js"></script>
    <script src="${base}/backstage/layui/layui.js"></script>
    <style>
        .mui-row span{
            font-size: 13px;
            font-weight: lighter;
        }
    </style>
</head>
<body>
<div class="mui-content">
    <#if size==0>
        <p style="text-align: center;color: red;margin-top: 10%;">暂无商品信息!</p>
    </#if>
    <#if size==1>
        <#list orderList as orderList>
            <div style="background: #ffffff;border-radius: 16px;margin: 10px 10px 10px 10px ">
                <ul class="">
                    <li class="mui-table-view-cell mui-media">
                        <a href="javascript:;">
                            <#if orderList.state==1>
                                <p>订单号:${orderList.oddNumber}<span style="float: right;color: #009f95">已付款</span></p>
                            </#if>
                            <#if orderList.state==2>
                                <p>订单号:${orderList.oddNumber}<span style="float: right;color: red">待付款</span></p>
                            </#if>
                            <#if orderList.state==3>
                                <p>订单号:${orderList.oddNumber}<span style="float: right">退货/售后</span></p>
                            </#if>
                            <#if orderList.state==4>
                                <p>订单号:${orderList.oddNumber}<span style="float: right;color: #f0ad4e">待发货</span></p>
                            </#if>
                            <#if orderList.state==5>
                                <p>订单号:${orderList.oddNumber}<span style="float: right;color: #df5000">待收货</span></p>
                            </#if>
                            <#if orderList.state==6>
                                <p>订单号:${orderList.oddNumber}<span style="float: right;color: #c66161">已发货</span></p>
                            </#if>
                            <#if orderList.state==7>
                                <p>订单号:${orderList.oddNumber}<span style="float: right;color: #009f95">已完成</span></p>
                            </#if>
                            <img class="mui-media-object mui-pull-left" style="width: 23%;height: 7%;" src="${orderList.goodUrl}">
                            <div class="mui-media-body">
                                <p class='mui-ellipsis'>&nbsp;&nbsp;&nbsp;${orderList.goodName}</p>
                            </div>
                        </a>
                        <div class="mui-row">
                            <span class="mui-col-xs-4">商品单价</span>
                            <span class="mui-col-xs-4">商品数量</span>
                            <span class="mui-col-xs-4">总付款金额</span>
                        </div>
                        <div class="mui-row">
                            <span class="mui-col-xs-4">￥${orderList.price}</span>
                            <span class="mui-col-xs-4"><span style="margin-left: 10%">${orderList.sum}</span></span>
                            <span class="mui-col-xs-4">￥${orderList.sumPrice}</span>
                        </div>
                        <div style="margin-top: 3px;">
                            <p>订单创建时间: ${orderList.time}</p>
                        </div>
                        <#if orderList.state==3>
                            <div style="float: right;font-size: 15px;color: darkgray;margin-top: 10px;">
                                <span style="margin-right: 10px;" onclick="window.location.href='${base}/wx/shoppingOrder/wl.html?kd='+'${orderList.kdNumber}'">查询物流</span>
                                <span style="color: #df5000" onclick="queren('${orderList.id}')">确认订单</span>
                            </div>
                        </#if>
                        <#if orderList.state==5>
                            <div style="float: right;font-size: 15px;color: darkgray;margin-top: 10px;">
                                <span style="margin-right: 10px;" onclick="window.location.href='${base}/wx/shoppingOrder/wl.html?kd='+'${orderList.kdNumber}'">查询物流</span>
                                <span style="color: #df5000" onclick="queren('${orderList.id}')">确认订单</span>
                            </div>
                        </#if>
                        <#if orderList.state==6>
                            <div style="float: right;font-size: 15px;color: darkgray;margin-top: 10px;">
                                <span style="margin-right: 10px;" onclick="window.location.href='${base}/wx/shoppingOrder/wl.html?kd='+'${orderList.kdNumber}'">查询物流</span>
                                <span style="color: #df5000" onclick="queren('${orderList.id}')">确认订单</span>
                            </div>
                        </#if>
                        <#if orderList.state==7>
                            <div style="float: right;font-size: 15px;color: darkgray;margin-top: 10px;">
                                <span style="margin-right: 10px;" onclick="window.location.href='${base}/wx/shoppingOrder/wl.html?kd='+'${orderList.kdNumber}'">查询物流</span>
                            </div>
                        </#if>
                    </li>
                </ul>
            </div>
        </#list>
    </#if>
</div>
</body>
<script>
    layui.use(['form', 'layer', 'upload'], function () {
        var form = layui.form
            , layer = layui.layer
            , $ = layui.jquery
            , upload = layui.upload;


    })
    function queren(id) {

        var formDate = {
            id:id
        }

        $.ajax({
            type: "POST",
            contentType: "application/json;charset=UTF-8",
            url: "${base}/wx/shoppingOrder/qianShou",
            data: JSON.stringify(formDate),
            success: function (data) {
                if (data.code === 200) {
                    layer.msg("签收成功")
                    window.location.href = "${base}/wx/shoppingOrder/shoppingOrder.html"
                } else {
                    layer.msg(data.msg)
                }
            }
        });
    }
</script>
</html>


